<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../js/vue.js"></script>
    <title>04_el与data的两种写法</title>
</head>

<body>
    <div id="root">
        <h1>{{name}}</h1>
    </div>

</body>
<script type="text/javascript">
    Vue.config.productionTip = false;

    const x = new Vue({
        // el: "#root",     //1
        // data: {
        //     name: '尚硅谷'
        // }                   //data的对象方法
        data() {
            return {
                name: "尚硅谷"
            }
        }
    });
    console.log(x);
    x.$mount("#root");     //2


</script>

</html>